function selection(array) {
    for (let j = 0; j < array.length; j++) {
        for (let i = j + 1; i < array.length; i++) {
            if (array[j] > array[i]) {
                let temp = array[j]
                array[j] = array[i]
                array[i] = temp
            }
        }
    }
}

let array = [100, 23, 45, 12, 25, 3, 90, 34]
selection(array)
console.log(array)